import {Dialog, Notify, Toast} from "vant";

let eraqDlg = {
  alert: function (message) {
    Dialog.alert({
      message,
      theme: 'round-button',
      overlay: true,
      showConfirmButton: true,
      confirmButtonText: "我知道了",
    });
  },
  confirm: function (message) {

  },
  info: function (message) {
    Notify({ type: 'primary', message, duration: 2000 });
  },
  warning: function (message) {
    Notify({ type: 'warning', message, duration: 2000 });
  },
  error: function (message) {
    Notify({ type: 'danger', message, duration: 2000 });
  },
  success: function (message) {
    Toast.success({ message, duration: 2000 });
  },
  showLoading: function (message) {
    return Toast.loading({
      message,
      forbidClick: true,
      duration: 0,
      overlay: true,
    });
  },
  hideLoading: function () {
    Toast.clear();
  }
}

export default eraqDlg;
